package br.com.fidalgotecnologia.layar.entity;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

@Entity
@Table(schema="poi", name="rotation")
@SequenceGenerator(sequenceName="poi.rotation_id_seq" , name="rotation_seq")
public class Rotation {
	private Long id;
	private Axis axis;
	private double angle;
	private boolean relative;
	
	@Id
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="rotation_seq")
	@Column(name="id")
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	@ManyToOne(cascade={CascadeType.ALL})
	@JoinColumn(name="Axis_id")
	public Axis getAxis() {
		return axis;
	}
	public void setAxis(Axis axis) {
		this.axis = axis;
	}
	@Column(name="angle")
	public double getAngle() {
		return angle;
	}
	public void setAngle(double angle) {
		this.angle = angle;
	}
	@Column(name="relative")
	public boolean isRelative() {
		return relative;
	}
	public void setRelative(boolean relative) {
		this.relative = relative;
	}
}
